package com.zz.study.sharding.constants;

/**
 * created by xjx on  2023-11-02 11:34
 */
public enum DSProcessSourceEnum {

    SHIPTRACK("dt_fusdata_temp","船舶轨迹"),
    SHIPALARM("alarms","船舶告警"),


    ;

    private String code;


    private String desc;




    public static DSProcessSourceEnum getByDesc(String desciption){
        DSProcessSourceEnum[] values = values();
        for(DSProcessSourceEnum disEnum : values){
            if(disEnum.getDesc().equals(desciption)){
                return disEnum;
            }
        }
        return null ;
    }

    public static DSProcessSourceEnum getByCode(String code){
        DSProcessSourceEnum[] values = values();
        for(DSProcessSourceEnum disEnum : values){
            if(code.equals(disEnum.getCode())){
                return disEnum;
            }
        }
        return null ;
    }





    DSProcessSourceEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
